$(document).ready(function()
{
	set_Color();
	//打开（关闭）登陆弹窗
	$("#loginButton").click(function(){
		showLogin();
	});
	$("#clLogin").click(function(){
		closeLogin();
	});

	//用户登录
	$("#toLogin").click(function(){
		//var loginUrl = "<?php echo site_url('student/login); ?>";
		//var loginUrl="http://[::1]/score/index.php/student/login";
		//alert(loginUrl);
		var id=$("#userLogin").val();
		var pwd=$("#pwdLogin").val();
		$.post(loginUrl,
			{id:id,pwd:pwd},
			function(data,status){
				if(data==1){
					//$.cookie('user',user,{path:'/',expires:10});
					document.location.reload();

				}
				else
					$("#fail").show();					
			});
		});

});


function showLogin(){
	//$(".bgObj").css("display","block");
	$(".loginDiv").css("display","block");
}

function closeLogin(){
	//$("#fail").css("display","none");
	//$(".bgObj").css("display","none");
	$(".loginDiv").css("display","none");
}

function set_Color()
{
	var url= window.location.href;
	var url_array = url.split("/");
	var select= url_array[url_array.length-1];
	select = select.split("#")[0];
	//alert(url_array[url_array.length-1]);
	$("#"+select).css("background","rgb(234,97,8)");
	switch(select)
	{
		case "verify":
		{
			$("#create").css("background","rgb(234,97,8)");
			break;
		}
		


	}

}